import type {TreeDataNode} from 'antd'

export interface DataSourceTreeNode extends TreeDataNode {
  id: string
  parentId?: string
  catalogName?: string
  nodeType: 'SERVER' | 'CATALOG' | 'DATABASE' | 'TABLE'
  databaseType?: 'MYSQL' | 'ORACLE' | 'POSTGRESQL' | 'SQLSERVER'
  enabled?: boolean
  activeDimensionName?: string
  children?: DataSourceTreeNode[]
}

export interface DataSourceTreeProps {
  data: DataSourceTreeNode[]
  loading?: boolean
  // 兼容上层传入的展示选项（暂不在组件内使用）
  displayServer?: boolean
  displayTable?: boolean
  selectedKeys?: string[]
  onSelect?: (node: DataSourceTreeNode) => void
}